﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;

namespace TrafficApp
{
    public class Garage
    {
        /// <summary>
        /// list of cars
        /// </summary>

        /// <summary>
        /// speed of car production
        /// </summary>
        private int quantifier;

        /// <summary>
        /// amount of cars, decreases after production per car
        /// </summary>
        private int amount;
        
        /// <summary>
        /// The index number of the garage
        /// </summary>
        private int garageIndexNumber = 0;

        /// <summary>
        /// location of the Garage
        /// </summary>

        private Vector Location;
        public Vector location
        {
            get
            {
                return Location;
            }
            set
            {
                Location = location;
            }
        }


        public void loc(Vector loc)
        {
            Location = loc; 
        }
        private int direction;

        /// <summary>
        /// constructor of the Garage
        /// </summary>
        /// <param name="Loc">upper left corner of the Garage</param>
        /// <param name="direction">1 = north, 2 = east, 3 = south, 4 = west</param>
        public Garage(Vector Loc, int dir)
        {
            Location = Loc;
            direction = dir;
            //Car car = new Car(Loc, true, Random)            
            //carGen();
        }

        /// <summary>
        /// generates cars.
        /// </summary>
        public Car carGen()
        {            
            //should have a road + lane in the paramaters of each car
            //App.MainTimer.Tick += new EventHandler(Tmr_Tick);
            //int limit = 20;
            Vector cVelocity;
            if (direction == 1)
                cVelocity = new Vector(0, -3);
            else if (direction == 2)
                cVelocity = new Vector(3, 0);
            else if (direction == 3)
                cVelocity = new Vector(0, 3);
            else
                cVelocity = new Vector(-3, 0);
            Vector temp = new Vector(0, 0);
            float temper = Location.X;
            temp.X = temper;
            temper = Location.Y;
            temp.Y = temper;
            Car car = new Car(temp, false, cVelocity, 0);
            return car;    
            //cList.Add(car);
            //return cList;
            //List.add<car>;            
        }

        
        //public void Tmr_Tick(object sender, EventArgs e)
        //{
            
        //}
    }
}
